using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;

using SharpCore.Data;
using SystemFramework.Util;

namespace TF.Access {
	public partial class TF_LeaveWord {

        private string nick_name;
        private string pic;

        public string Nick_Name
        {
            get
            {
                return nick_name;
            }
            set
            {
                nick_name = value;
            }
        }

        public string Pic
        {
            get
            {
                return pic;
            }
            set
            {
                pic = value;
            }
        }

        /// <summary>
        /// Selects all records from the TF_LeaveWords table.
        /// </summary>
        public static List<TF_LeaveWord> SelectLeaveWordByEleId(int eleId, string eleType, int pageSize, int pageIndex)
        {
            using (SqlDataReader dataReader = SqlClientUtility.ExecuteReader("TF_LeaveWordSelectByEleId", eleId, eleType, pageSize, pageIndex))
            {
                List<TF_LeaveWord> tF_LeaveWordList = new List<TF_LeaveWord>();
                while (dataReader.Read())
                {
                    TF_LeaveWord tF_LeaveWord = MakeTF_LeaveWord(dataReader);
                    tF_LeaveWord.Nick_Name = ConvertHelper.GetString(dataReader["Nick_Name"], string.Empty);
                    tF_LeaveWord.pic = ConvertHelper.GetString(dataReader["pic"], string.Empty);
                    tF_LeaveWordList.Add(tF_LeaveWord);
                }
                return tF_LeaveWordList;
            }
        }

        /// <summary>
        /// Selects all records from the TF_LeaveWords table.
        /// </summary>
        public static int SelectLeaveWordByEleIdCount(int eleId, string eleType)
        {
            return ConvertHelper.GetInt(SqlClientUtility.ExecuteScalar("TF_LeaveWordSelectByEleIdCount", eleId, eleType), 0);
        }
	}
}
